/* 用户相关请求模块 */
import request from "../utils/request";
// import  qs from 'qs'

// 登录请求
export const login = (data) => {
  return request({
    method: "POST",
    headers: {
      'Content-Type': 'application/json'
    },
    url: "/api/user/login-v1",
    data
  });
};

export const get_version = () => {
  return request({
    method: "get",
    url: "/api/appAssess/enableStandard"
  });
};

export const get_no = () => {
  return request({
    method: "get",
    url: "/api/appAssess/generateAssessNo"
  });
};

// 获取字典树结构
export const get_dict = () => {
  return request({
    method: "POST",
    url: "/api/dict/listDictTree",
  });
};

// 获取每级区划
export const get_area = (data) => {
  return request({
    method: "POST",
    url: "/api/area/getNextAreaInfoByCode",
    data,
  });
};

// 获取字典
export const get_dict_options = (params) => {
  return request({
    method: "get",
    url: "/api/dict/listDict",
    params,
  });
};

// 获取所有区划
export const get_all_area = (data) => {
  return request({
    method: "POST",
    url: "/api/area/areaListTreeH5",
    data,
  });
};

// 上传
export const upload_file = (data) => {
  return request({
    method: "POST",
    headers: {
      "Content-Type": "multipart/form-data",
    },
    url: "/api/file/upload_v1",
    data: data,
  });
};

// 回显附件
export const get_files = (params) => {
  return request({
    method: "GET",
    url: "/api/file/getFilesByBiz",
    params,
  });
};

// file前缀
export const get_file_ip = () => {
  return request({
    method: "GET",
    url: "/api/file/config",
    params: new Date().getTime(),
  });
};

// export const get_test = () => {
//   return request({
//     method: 'GET',
//     url: 'http://60.168.132.92:9880/elderRoster/selectElderRosterByIdCard',
//     params:new Date().getTime()
//   })
// }

// 修改密码
export const changePwd = (data) => {
  return request({
    method: "POST",
    url: "/api/user/changePasswrod",
    data,
  });
};

// 获取用户密码规范信息
export function getUserCheckPwd() {
  return request({
    url: "/api/user/checkPwd",
    method: "get",
  });
}

// 获取验证码的装态
export function getIsCodeImg(data) {
  return request({
    url: "/api/sysparam/getByCode",
    method: "get",
    params: data,
  });
}

// 获取验证码
export function getCodeImg(data) {
  return request({
    url: "/api/captcha/get",
    method: "get",
    params: data,
  });
}
// 修改密码
export function updatePwd(data) {
  return request({
    url: "/api/user/updatePwd",
    method: "post",
    data: data,
  });
}
